package com.code.wflow.node;

import com.code.wflow.bo.AssignedUserBO;
import com.code.wflow.constants.AssignedTypeEnum;
import lombok.Data;

import java.util.List;

/**
 * @author ggh
 * @date 2022/11/10
 */
@Data
public class CCNodeProperties implements SupportSelfSelectNodeProperties {

    private Boolean shouldAdd;

    private List<? extends AssignedUserBO> assignedUser;

    @Override
    public String assignedType() {
        return shouldAdd ? AssignedTypeEnum.SELF_SELECT.getType() : AssignedTypeEnum.ASSIGN_USER.getType();
    }

    @Override
    public List<? extends AssignedUserBO> assignedUser() {
        return this.getAssignedUser();
    }

    @Override
    public void setAssignUser(List<? extends AssignedUserBO> assignedUserList) {
        this.assignedUser = (List<AssignedUserBO>) assignedUserList;
    }
}
